#include "threadPool_v4.hpp"
#include "task.hpp"
#include <iostream>
#include <memory>

using namespace std;



int main(){

    
    // unique_ptr<ThreadPool<Task>> tp(new ThreadPool<Task>());
    // tp->init();
    // tp->start();

    // tp->check();

    //充当生产者
    while(1){

        int x = 0;
        int y = 0;
        char op;
        cout << "enter x >";
        cin >> x;
        cout << "enter y >";
        cin >> y;
        cout << "enter op(+-*/%) >";
        cin >> op;
        
        Task t(x, y, op);
        ThreadPool<Task>::getInstance()->pushTask(t);
        // tp->pushTask(t);

        sleep(1);
        //tp->pushTask();
    }

    return 0;
}